package com.briup.app02.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.app02.bean.CertificationApply;
import com.briup.app02.bean.CertificationApplyExample;
import com.briup.app02.dao.CertificationApplyMapper;
import com.briup.app02.service.ICertificationApplyService;

@Service
public class CertificationApplyServiceImpl implements ICertificationApplyService{
	@Autowired
	private CertificationApplyMapper certificationapplyMapper;
	
	@Override
	public List<CertificationApply> findAll() {
		// 模板查询
		CertificationApplyExample example = new CertificationApplyExample();
		return certificationapplyMapper.selectByExample(example);
	}

	@Override
	public void saveOrUpdate(CertificationApply certificationapply) {
		if(certificationapply.getId() == null) {
			certificationapplyMapper.insert(certificationapply);
		} else {
			certificationapplyMapper.updateByPrimaryKey(certificationapply);
		}
	}

	@Override
	public CertificationApply findById(long id) {
		return certificationapplyMapper.selectByPrimaryKey(id);
	}

	@Override
	public void deleteById(long id) {
		certificationapplyMapper.deleteByPrimaryKey(id);
	}
}
